<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box{
            width: 200px;
            height: 200px;
            background-color: red;
            padding: 30px;
            border: 10px solid #ccc;
            margin: 100px;
        }
    </style>
</head>
<body>
    <div id="box">撩课</div>
    <script>
        /*
            client家族常用的两个属性：clientWidth，clientHeight在网页中可见区域的长和宽：自身长或者宽+padding
            clientLeft,clientTop代表的左边或者上边的边框
        */
        let box = document.getElementById('box');
        console.log(box.clientWidth,box.clientHeight);
        console.log(box.clientTop,box.clientLeft);
    </script>
</body>
</html>